﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace comdiinfo
{
    public class G64FileSignature : G64Element<String>
    {
        public G64FileSignature(int trackNo)
            : base(trackNo)
        {
            elementName = "File Signature";
        }
        public override void LoadData(ref G64ImageData imgData, int srcOffset, int count)
        {
            ElementValue = Encoding.ASCII.GetString(imgData.readBytes(0, 8, elementName));
        }
        public override void CheckValue()
        {
            if (ElementValue == "GCR-1541")
            {
                elementStatus = G64ElementStatus.Ok;
            }
            else
            {
                elementStatus = G64ElementStatus.Error;
                elementStatusText.AppendFormat("{0} {1} ({2})", elementName, "muss 'GCR-1541' sein!", ElementValue.ToString());
                elementStatusText.AppendLine();
            }
        }
    }
}
